# 创建集合包含1到10之间的偶数
even_numbers = {num for num in range(1, 11) if num % 2 == 0}
print(even_numbers)  # 输出：{2, 4, 6, 8, 10}

# 检查两个集合元素是否相同
set1 = {1, 2, 3}
set2 = {1, 2, 3}
print(set1 == set2)  # 输出：True

# 返回两个集合的并集
set1 = {1, 2, 3}
set2 = {3, 4, 5}
union = set1.union(set2)
print(union)  # 输出：{1, 2, 3, 4, 5}

# 返回两个集合的交集
set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection = set1.intersection(set2)
print(intersection)  # 输出：{3}

# 返回在第一个集合但不在第二个集合的元素
set1 = {1, 2, 3}
set2 = {3, 4, 5}
difference = set1.difference(set2)
print(difference)  # 输出：{1, 2}